#include<bits/stdc++.h>
using namespace std;
stack<int>stk;
int n , a[110];
int main(){
	freopen("marshalling.in" , "r" , stdin);
	freopen("marshalling.out" , "w" , stdout);
	cin >> n;
	for(int i = 1 ; i <= n ; i++){
		cin >> a[i];
	}
	for(int i = 1 , j = 1 ; i <= n ; i++){
		stk.push(i);
		cout << 'A';
		while(stk.size() && stk.top() == a[j]){
			stk.pop();
			j++;
			cout << 'B';
		}
	}
	return 0;
}
